#ifndef Planev2_H_
#define Planev2_H_
#include "Point.h"
#include <Eigen/Core>
#include <iostream>
#include <vector>
#include <Eigen/LU>
#include <Eigen/Eigenvalues> 
#include <Eigen/Eigen>
#include <Eigen/SVD>
#include <Eigen/Core>

using namespace Eigen;

class Planev2
{
	public:
	int id;
	bool use_boundaries;
	Matrix3f plane_points;
	float normal_x;
	float normal_y;
	float normal_z;
	float point_x;
	float point_y;
	float point_z;
	
	float a,b,c,d;
	Planev2(Point * a, Point * b,Point * c);
	Planev2(std::vector<Point *> * points);
	Planev2();
	~Planev2();
	void setup(Point * a, Point * b,Point * c);
	void setup(std::vector<Point *> * points);
	void getABCDcoefs();
	void project_points(std::vector<Point *> points);
	float distance(Point * point);
	std::vector< Plane *> * extract_subplanes(std::vector<Point *> * points);
	void setBoundaries(std::vector<Point *> * points);
};
#endif
